<template>
  <div class="home">
     <my-header title="商品首页" @abc="partShow"></my-header>
     <p>我是p标签的节点</p>
  </div>
</template>
<script>
// @ is an alias to /src
import MyHeader from '../components/myHeader'
import { onMounted } from 'vue';
export default {
  name: 'HomeView',
  components: {
    MyHeader
  },
  setup(props) { // 所有在组合api里面要用到的东西都需要引入。
    const partShow = (val) => {
       alert('我是首页触发的文案'+val)
    }
    onMounted(() => {
      let dom = document.querySelector('p');
      console.log(dom);
    })
    return {
      partShow
    }
  }
}
</script>
